import { defHttp } from '/@/utils/http/axios';

enum Api {
  list = '/banck/businessReport/incomeStatementReport',
  importExcel = '/channelReport/channelReport/importExcel',
  exportXls = '/banck/businessReport/incomeStatementReportExcel',
}

/**
 * 导出api
 * @param params
 */
export const getExportUrl = Api.exportXls;

/**
 * 导入api
 */
export const getImportUrl = Api.importExcel;

// mock 加数组 数要随机
const mockData = [
  {
    aloneBrokerAmt: 21,
    area: '地区1',
    balanceAmt: 21,
    brokerAmt: 43,
    brokerageAmt: 54,
    channel: '渠道1',
    channelAmt: 32,
    channelBrokerAmt: 23,
    channelTaxAmt: 43,
    systemServiceAmt: 54,
  },
  {
    aloneBrokerAmt: 251,
    area: '地区2',
    balanceAmt: 241,
    brokerAmt: 433,
    brokerageAmt: 564,
    channel: '渠道2',
    channelAmt: 22,
    channelBrokerAmt: 33,
    channelTaxAmt: 32,
    systemServiceAmt: 32,
  },
  {
    aloneBrokerAmt: 21,
    area: '地区1',
    balanceAmt: 21,
    brokerAmt: 43,
    brokerageAmt: 54,
    channel: '渠道1',
    channelAmt: 32,
    channelBrokerAmt: 23,
    channelTaxAmt: 43,
    systemServiceAmt: 54,
  },
  {
    aloneBrokerAmt: 251,
    area: '地区2',
    balanceAmt: 241,
    brokerAmt: 433,
    brokerageAmt: 564,
    channel: '渠道1',
    channelAmt: 22,
    channelBrokerAmt: 33,
    channelTaxAmt: 32,
    systemServiceAmt: 32,
  },
  {
    aloneBrokerAmt: 2521,
    area: '地区2',
    balanceAmt: 2413,
    brokerAmt: 4333,
    brokerageAmt: 564,
    channel: '渠道2',
    channelAmt: 242,
    channelBrokerAmt: 333,
    channelTaxAmt: 352,
    systemServiceAmt: 362,
  },
  {
    aloneBrokerAmt: 251,
    area: '地区2',
    balanceAmt: 241,
    brokerAmt: 423,
    brokerageAmt: 564,
    channel: '渠道2',
    channelAmt: 232,
    channelBrokerAmt: 343,
    channelTaxAmt: 352,
    systemServiceAmt: 362,
  },
  {
    aloneBrokerAmt: 2451,
    area: '地区2',
    balanceAmt: 2431,
    brokerAmt: 4323,
    brokerageAmt: 5634,
    channel: '渠道2',
    channelAmt: 232,
    channelBrokerAmt: 353,
    channelTaxAmt: 342,
    systemServiceAmt: 352,
  },
];
/**
 * 列表接口
 * @param params CHECKING
 */
export const list = (params) => {
  // return Promise.resolve({
  //   records: mockData,
  //   total: 1,
  //   size: 10,
  //   current: 1,
  //   optimizeCountSql: true,
  //   searchCount: true,
  //   countId: null,
  //   maxLimit: null,
  //   pages: 0,
  // });
  return defHttp.post({ url: Api.list, params });
};
